<?php
/**
* This global view template is used within popup windows.
* Primary aims of this template are
* - to have a liquid width
* - have no elements other than the action view
*
* The admin theme will be included here, so the theme CSS needs to alter certain
* elements in order to look nice in a popup. To aid this, the <body> tag is
* given a "popup" class.
*
* @package Scribble
*/
use Buan\Config;
use Buan\Core;
use Buan\UrlCommand;
use Buan\View;
$urlRoot = Config::get('ext.Scribble.urlRoot');
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html" />

	<title><?php $this->html->e(Config::get('ext.Scribble.appName')); ?></title>

	<?php 
	/* External stylesheets */
	echo $this->getView()->getStylesheetsView()->renderAfter($this->getView()->getSlot('systemlog'), $this->getView());
	?>
</head>
<body class="popup">
<div id="body">
	<?php $sws = $this->getView()->getSlot('secondary')->render(); ?>
	<div id="wrap-workspace">
		<div id="workspace" class="float-wrapper<?php echo $sws=='' ? '' : ' dual-workspace'; ?>">
			<div id="primary-workspace">
				<div>
					<?php echo $this->getView()->getSlot('systemlog')->renderAfter($this->getView()); ?>
				</div>
		
				<div id="slot-action">
					<?php echo $this->getView()->getSlot('action')->render(); ?>
				</div>
			</div>
	
			<?php if($sws!=''): ?>
			<div id="secondary-workspace">
				<div id="slot-secondary">
					<?php echo $sws; ?>
				</div>
			</div>
			<?php endif; ?>
		</div>
	</div>
</div>

<?php
/* External Javascripts */
include_once(Config::get('core.dir.resources').'/js/Buan.js.php');
echo $this->getView()->getJavascriptsView()->render();
?>

<?php /* Make a few Scribble config vars available to javascript */ ?>
<script type="text/javascript">
Buan.Config.set('ext.Scribble.urlRoot', '<?php $this->html->e(Config::get('ext.Scribble.urlRoot')); ?>');
Buan.Config.set('ext.Scribble.urlSuffix', '<?php $this->html->e(Config::get('ext.Scribble.urlSuffix')); ?>');
</script>
</body>
</html>